<#include "../common/header.htm">
<div class="content-wrapper">
	<section class="content-header">
		<ol class="breadcrumb">
			<li><a href="${ctx}/">首页</a></li>
			<li class="active"><a href="${ctx}/ordercommission/list">佣金列表</a></li>
		</ol>
	</section>
	<section class="content">
		<div class="box">
		  <form action="${ctx}/ordercommission/list" method="get" id="orderCommissionList">
			<div class="box-header">
				<div class="row RowSearchWork">
					<div class="col-sm-2 ">
						<label>订单号：</label>
						<input type="text"  name="orderNo" class="form-control" placeholder="订单号" value="${commission.orderNo!}"  />
					</div>
					<#--
					<div class="col-sm-2 ">
						<label>下单人：</label>
						<input type="text"  name="buyName" class="form-control" placeholder="下单人" value="${commission.buyName!}"  />
					</div>
					<div class="col-sm-2 ">
						<label>受益人：</label>
						<input type="text"  name="beneficiaryName" class="form-control" placeholder="受益人" value="${commission.beneficiaryName!}"  />
					</div>
					-->
					<div class="col-sm-3" style="display: -webkit-box;">
						<label>受益时间：</label>
						<div class="input-group">
							<input type="text" class="form-control" name="startTime" value="${commission.startTime!}" id="startTime" autocomplete="off">
							<div class="input-group-addon">
								<i>-</i>
							</div>
							<input type="text" class="form-control" name="endTime" value="${commission.endTime!}" id="endTime" autocomplete="off">
						</div>
					</div>
					<div class="col-sm-1 ml60">
						<input type="button"  class="btn btn-default btn-search" onclick="ordercommission.query()" value="查询" />
					</div>
				</div>
			</div>
			<div class="box-body">
				<table class="table table-hover table-bordered table-striped table-hide">
					<thead>
						<tr>
							<th width="4%">序号</th>
							<th width="20%">订单号</th>
							<th width="15%">受益时间</th>
							<th width="10%">受益人</th>
							<th width="8%">佣金金额</th>
							<th width="8%">佣金类型</th>
							<th width="8%">是否提现</th>
							<th width="12%">下单公司</th>
							<th width="8%">支付金额</th>
							<th width="8%">操作人</th>
							<th width="8%">操作</th>
						</tr>
					</thead>
					<tbody>
						<#list page.content as w>
						<tr>
							<td>${page.size*page.number+w_index+1}</td>
							<td>${w.orderNo!}</td>
							<td>${w.commissionTime!}</td>
							<td>${w.beneficiaryName!}</td>
							<td>${w.commission!}</td>
							<td>${(w.commissionType==1)?string('上级','上上级')}</td>
							<td>${(w.state==0)?string('未提现','已提现')}</td>
							<td>${w.companyName!}</td>
							<td>${w.payMoney!}</td>
							<td>${w.processerName!}</td>
							<#if w.state==1>
								<td>已提现</td>
							<#else>
								<td><a href="javascript:void(0)" onclick="ordercommission.deal(${w.id!})">提现</a></td>
							</#if>
						</tr>
						</#list>
					</tbody>
				</table>
				<#include "../common/page.htm">
			</div>
		 </form>
	  </div>
	</section>
</div>
<#include "../common/footer.htm">

<script type="text/javascript">
	$(function () {
        $('#startTime').datepicker({
            autoclose: true,
            format: 'yyyy-mm-dd',
            clearBtn: true,
            language: 'zh-CN'
        });
        $('#endTime').datepicker({
            autoclose: true,
            clearBtn: true,
            format: 'yyyy-mm-dd',
            language: 'zh-CN'
        });
    })
    var ordercommission = {
        query : function() {
            $(":input[name='pageNumber']").val(0);
            $("form").submit();
        },
		deal:function (id) {
            bootbox.confirm({
                message: "你确认提现吗？",
                buttons: {
                    confirm: {
                        label: '确定'
                    },
                    cancel: {
                        label: '取消'
                    }
                },
                callback: function (result) {
                    if (result){
                        window.location.href="${ctx}/ordercommission/cash?commissionId="+id;
                    }
                }
            });
        }
    }
</script>